﻿using System.Collections.Generic;
using System.Linq;

namespace LaxCraft.Domain
{
	public class Player : EntityBase
	{
        public virtual string Name { get; set; }

        public virtual IList<PlayerStat> PlayerStats { get; set; }

        public virtual IEnumerable<PlayerStat> GetCompletePlayerStats(IEnumerable<Stat> stats)
        {
            foreach (var stat in stats)
                yield return PlayerStats.FirstOrDefault(s => stat.Id == s.Stat.Id) ??
                             new PlayerStat() { Stat = stat, XP = 0 };
            yield break;
        }

	}
}